package com.amrit.threads;


public class ThreadTest {
	public static void main(String[] args) throws InterruptedException {
		//ExecutorService exeServ = Executors.newFixedThreadPool(1);

		MyThread mtA = new MyThread("A", 6);
		mtA.setPriority(10);
		MyAnotherThread mtB = new MyAnotherThread("B", 6);
		//mt1.run();
		MyThread mtC = new MyThread("C", 6);
		MyAnotherThread mtD = new MyAnotherThread("D", 6);
		MyThread mtE = new MyThread("E", 6);
		MyAnotherThread mtF = new MyAnotherThread("F", 6);
		Runnable r1 = new ThreadRunnable("G", 6);
		Thread mtG = new Thread(r1);
		/*exeServ.submit(r1);
		exeServ.submit(mt);
		exeServ.submit(mt1);
		exeServ.submit(mt2);
		exeServ.submit(mt3);
		exeServ.submit(mt4);
		exeServ.submit(mt5);*/
		mtF.setPriority(9);
		mtC.setDaemon(true);

		mtA.start();
		mtA.join();
		mtB.start();
		mtB.join();
		mtC.start();
		mtC.join();
		mtD.start();
		mtD.join();
		mtE.start();
		mtE.join();
		mtF.start();
		mtF.join();
		mtG.join();
		mtG.start();
	}

}
